import React, { Component } from 'react';
import './manage.css'
import Discuss from './Discuss';
import { adminCheck, ReportCreator,FeedbackCreator,ExamineCreator } from '../Redux/ActionCreator';
import { connect } from 'react-redux';
import SIdmenu from './SIdmenu';
import { Badge } from 'antd-mobile';
//举报管理页面
class DiscussManage extends Component {
    constructor(props) {
        super(props)
        this.props.dispatch(adminCheck())
        this.props.dispatch(ExamineCreator())
        this.props.dispatch(ReportCreator())
        this.props.dispatch(FeedbackCreator())
    }
    render() {
        return (
            <div className="box" >
                <SIdmenu />
                <div className="box_body">
                    <div className='body_left'>
                        <span id='menu'><i className='iconfont icon-zhongbiao'></i>系统菜单</span>
                        <ul>
                            <li onClick={() => this.props.history.push('/systemmanage')}>系统管理</li>
                            <li onClick={() => this.props.history.push('/fruitermanage')}>果农管理</li>
                            <li onClick={() => this.props.history.push('/usermanage')}>用户管理</li>
                            <li onClick={() => this.props.history.push('/communitymanage')}>动态管理</li>

                            <li onClick={() => this.props.history.push('/feedbackmanage')}><Badge text={this.props.feedbackreducer.length}>反馈管理</Badge></li>
                            {/* <li onClick={() => this.props.history.push('/fruitermanage')}>果农管理</li> */}
                            <li onClick={() => this.props.history.push('/discussmanage')}><Badge text={this.props.reportreducer.length}>举报管理</Badge></li>
                            <li onClick={() => this.props.history.push('/commoditymanage')}><Badge text={this.props.examinereducer.length}>商品审核</Badge></li>
                        </ul>
                    </div>
                    <Discuss />
                </div>
            </div>
        );
    }
}

const mapStateToProps = (state) => ({
    adminlist: state.adminreducer.adminlist,
    reportreducer:state.reportreducer,
    examinereducer: state.examinereducer,
    feedbackreducer:state.feedbackreducer
})
export default connect(mapStateToProps)(DiscussManage);